package com.yiip.mr.kvformat;

import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;

//text，text是因为要使用kvtextformat，不需要使用偏移量。key：第一个单词，value：后面的所有都是value
public class KVTextMapper extends Mapper<Text, Text, Text, LongWritable> {

    LongWritable longWritable = new LongWritable(1);

    @Override
    protected void map(Text key, Text value, Context context) throws IOException, InterruptedException {
        context.write(key, longWritable);
    }
}
